<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>沈阳国安驾校</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta charset="utf-8">
<link href="${ctx}/guanaHTML/news.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/guanaHTML/iscroll-1.css" rel="stylesheet"
	type="text/css" />
<script src="${ctx}/guanaHTML/iscroll-1.js" type="text/javascript"></script>
<script type="text/javascript">
	var myScroll;

	function loaded() {
		myScroll = new iScroll(
				'wrapper',
				{
					snap : true,
					momentum : false,
					hScrollbar : false,
					onScrollEnd : function() {
						document.querySelector('#indicator > li.active').className = '';
						document.querySelector('#indicator > li:nth-child('
								+ (this.currPageX + 1) + ')').className = 'active';
					}
				});

	}

	document.addEventListener('DOMContentLoaded', loaded, false);
</script>
</head>
<script>
	window.onload = function() {
		var oWin = document.getElementById("win");
		var oLay = document.getElementById("overlay");
		var oBtn = document.getElementById("popmenu");
		var oClose = document.getElementById("close");
		oBtn.onclick = function() {
			oLay.style.display = "block";
			oWin.style.display = "block"
		};
		oLay.onclick = function() {
			oLay.style.display = "none";
			oWin.style.display = "none"
		}
	};
</script>
<body id="listhome1">
	<div id="ui-header">
		<div class="fixed">
			<a class="ui-title" id="popmenu">选择分类</a> <a class="ui-btn-left_pre"
				href="javascript:history.go(-1)"></a> <a class="ui-btn-right"
				href="javascript:document.location.reload()"></a>
		</div>
	</div>
	<div id="overlay"></div>
	<div id="win">
		<ul class="dropdown">
			<c:forEach var="advType" items="${advTypes}" varStatus="status">
				<li><a href="${ctx}/weixin/adv/list/${advType.id}"><span>${advType.title}</span>
				</a></li>
			</c:forEach>
			<div class="clr"></div>
		</ul>
	</div>
	<div class="Listpage">
		<div class="banner">
			<div id="wrapper">
				<div id="scroller">
					<ul id="thelist">
						<li>
							<p></p> <a href="#"> <img src="${ctx}/guanaHTML/index.jpg" />
						</a>
						</li>
						<li>
							<p></p> <a href="#"> <img src="${ctx}/guanaHTML/banner2.jpg" />
						</a>
						</li>
						<li>
							<p></p> <a href="#"> <img src="${ctx}/guanaHTML/banner3.jpg" />
						</a>
						</li>
					</ul>
				</div>
			</div>
			<div id="nav">
				<div id="prev"
					onclick="myScroll.scrollToPage('prev', 0,400,3);return false">
					&larr; prev</div>
				<ul id="indicator">
					<li class="active">1</li>
					<li>2</li>
					<li>3</li>
				</ul>
				<div id="next"
					onclick="myScroll.scrollToPage('next', 0);return false">next
					&rarr;</div>
			</div>
			<div class="clr"></div>
		</div>
		<div id="insert1"></div>
		<script>
			var count = document.getElementById("thelist")
					.getElementsByTagName("img").length;

			for (i = 0; i < count; i++) {
				document.getElementById("thelist").getElementsByTagName("img")
						.item(i).style.cssText = " width:"
						+ document.body.clientWidth + "px";

			}

			document.getElementById("scroller").style.cssText = " width:"
					+ document.body.clientWidth * count + "px";

			setInterval(function() {
				myScroll.scrollToPage('next', 0, 400, count);
			}, 3500);

			window.onresize = function() {
				for (i = 0; i < count; i++) {
					document.getElementById("thelist").getElementsByTagName(
							"img").item(i).style.cssText = " width:"
							+ document.body.clientWidth + "px";

				}

				document.getElementById("scroller").style.cssText = " width:"
						+ document.body.clientWidth * count + "px";
			}
		</script>
		<div id="insert2"></div>

		<div id="todayList">
			<ul class="todayList">
				<c:forEach var="adv" items="${advs}" varStatus="status">
					<li><a href="${ctx}/weixin/adv/content/${adv.id}"><div
								class="img">
								<img src="${adv.imgUrl}">
							</div>
							<h2>${adv.title}</h2>
							<p class="onlyheight">${adv.info}</p>
							<div class="commentNum"></div> </a></li>
				</c:forEach>
			</ul>
		</div>
	</div>
	<div class="copyright">技术支持:沈阳凯鸿科技有限公司</div>
	<script>
		function dourl(url) {
			location.href = url;
		}
	</script>
	<div style="display: none"></div>
</body>
</html>